
import request from '@/router/axios'
import qs from 'qs'
import store from '@/store'


export const loginByUsername = (username, password,captchaType,code) => {

  let dataObj = qs.stringify({'username': username, 'password': password})

  return request({
    url: '/api/sys/user/login',
    method: 'post',
    // headers:{
    //   serialize:true
    // },
    params: {captchaType, code},
    data: dataObj
  })
}

export const logout = () => {
  return request({
    url: '/api/sys/user/logout',
    method: 'get'
  })
}

export const getUserInfo = () => {
  return request({
    url: '/api/sys/user/info',
    method: 'get'
  })
}
